package com.itic.codeGen.codeGenerator.workLine;

import java.util.List;
import java.util.Map;

import com.itic.codeGen.codeGenerator.util.CommonUtils;
import com.itic.codeGen.codeGenerator.util.CommonUtils.FILE_TYPE;

public class TargetXML {
    private String pkage;
    private String project;
    private String xmlName;
    private String baseName;
    private List<String> xmlSqlBody;

    public TargetXML(Map<String, Object> params) {
	pkage = null == params.get("package") ? null : params.get("package")
	        + "";
	project = null == params.get("project") ? null : params.get("project")
	        + "";
    }

    @SuppressWarnings("unchecked")
    public void setFileType(Map<String, Object> params, FILE_TYPE ft) {
	this.setPkage(CommonUtils.packageFomatter(
	        null == params.get("package") ? null : params.get("package")
	                + "", ft));
	this.setBaseName(null == params.get("xmlBaseName") ? null : params
	        .get("xmlBaseName") + "");
	this.setXmlName(null == params.get("xmlDomain") ? null : params
	        .get("xmlDomain") + "" + ft.getType());
	this.setXmlSqlBody(null == params.get("xmlSqlBody") ? null : (List<String>)params
            .get("xmlSqlBody"));
    }

    public String getBaseName() {
	return baseName;
    }

    public void setBaseName(String baseName) {
	this.baseName = baseName;
    }

    public String getPkage() {
	return pkage;
    }

    public void setPkage(String pkage) {
	this.pkage = pkage;
    }

    public String getProject() {
	return project;
    }

    public void setProject(String project) {
	this.project = project;
    }

    public String getXmlName() {
	return xmlName;
    }

    public void setXmlName(String xmlName) {
	this.xmlName = xmlName;
    }

    public List<String> getXmlSqlBody() {
        return xmlSqlBody;
    }

    public void setXmlSqlBody(List<String> xmlSqlBody) {
        this.xmlSqlBody = xmlSqlBody;
    }
    
}
